package com.example.administrator.printoutindemo.mvp.ui.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.administrator.printoutindemo.R;
import com.example.administrator.printoutindemo.mvp.ui.entity.SearchOutStorageListForLeader;

import java.util.List;


public class ChuKuQingKuangAdapter extends BaseQuickAdapter<SearchOutStorageListForLeader, BaseViewHolder> {

    private Context mContext;
    private IChuKuQingKuangAdapter mIChuKuQingKuangAdapter;

    public ChuKuQingKuangAdapter(Context context, @Nullable List<SearchOutStorageListForLeader> data, IChuKuQingKuangAdapter iChuKuQingKuangAdapter) {
        super(R.layout.item_chu_ku_qing_kuang, data);
        this.mContext = context;
        this.mIChuKuQingKuangAdapter = iChuKuQingKuangAdapter;
    }

    @Override
    protected void convert(BaseViewHolder helper, SearchOutStorageListForLeader item) {
//        GlideUtil.loadImage(mContext, item.getImg(), helper.getView(R.id.img_product));
        helper.setText(R.id.tv_xiang_mu_ming_cheng, item.getProjectname());
        helper.setText(R.id.tv_xiang_mu_bian_hao, item.getProid());
        helper.setText(R.id.tv_mu_di_xiang_mu, item.getTargetProject());
        helper.setText(R.id.tv_cang_ku, item.getSpname());
        helper.setText(R.id.tv_gong_ying_shang, item.getSupplier());
        helper.setText(R.id.tv_wu_liao_ming_cheng, item.getMaterial());
        helper.setText(R.id.tv_shuliang, item.getNums());
        helper.setText(R.id.tv_jie_shou_ren, item.getReceiveUsername());
        helper.setText(R.id.tv_jie_shou_dian_hua, item.getReceiveMobile());
        helper.setText(R.id.tv_chu_ku_shi_jian, item.getOuttime());
        helper.setOnClickListener(R.id.btn_fen_ma, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mIChuKuQingKuangAdapter.fenMa(item);
            }
        });
    }

    public interface IChuKuQingKuangAdapter {

        void fenMa(SearchOutStorageListForLeader item);
    }

}
